package com.huang.controller;

import com.huang.pojo.Student;
import com.huang.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @Author:huang
 * @Date: Created in 2021/5/16 8:44
 */
@Controller
@RequestMapping("/s")
public class StudentController {

    @Autowired
    @Qualifier("StudentServiceImpl")
    private StudentService studentService;

    @RequestMapping("/c1")
    public String query(Model model){

        List<Student> studentList = studentService.queryAll();
        model.addAttribute("msg",studentList);


        return "hello";
    }
}
